#include <iostream>

using namespace std;

int main()
{
	int n = 0;
	cin >> n;

	int cnt = 0;
	if (n % 4 == 0 && n % 100 != 0 || n % 400 == 0)
		cnt = 1;

	cout << cnt << endl;

	return 0;
}